package com.dao;

import java.util.List;

import org.mybatis.spring.SqlSessionTemplate;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Repository;

import com.po.TeacherPO;
@Repository
public class TeacherDao {
	@Autowired
	private SqlSessionTemplate sqlTemplate;
	/**
	 * 查找教师的信息
	 * @return
	 */
	public List<TeacherPO> findTeacherInfo() {
		return sqlTemplate.selectList("teacher.findTeacherInfo");
	}
	/**
	 * 添加教师信息
	 * @param teacherPO 
	 */
	public void addTeacherInfo(TeacherPO teacherPO) {
		sqlTemplate.insert("teacher.addTeacherInfo",teacherPO);
	}
	/**
	 * 修改时查找回显数据
	 * @param id
	 * @return
	 */
	public TeacherPO findTeacherInfoById(String id) {
		return sqlTemplate.selectOne("teacher.findTeacherInfoById",id);
	}
	/**
	 * 修改数据
	 * @param teacherPO
	 */
	
	public void updateInfo(TeacherPO teacherPO) {
		sqlTemplate.update("teacher.updateInfo",teacherPO);
	}
	/**
	 * 
	 * @param id
	 */
	public void deleteTeacherInfoById(String id) {
		sqlTemplate.delete("teacher.deleteTeacherInfoById", id);
	}
	
	


}
